package com.teatang.tadmin.sysmenu.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.teatang.tadmin.core.domain.BasePojo;
import com.teatang.tadmin.core.domain.TreeObj;
import lombok.Data;

import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SysMenu<E> extends BasePojo implements TreeObj<E> {
    private Long id;
    private Long pid;
    private String title;
    private Integer type;
    private String icon;
    private String perms;
    private String href;
    private Integer sort;
    private String remark;

    private List<E> child;

    @Override
    public Long primaryKey() {
        return id;
    }

    @Override
    public Long parentKey() {
        return pid;
    }

    @JsonIgnore
    @Override
    public List<E> getTreeObjChild() {
        return child;
    }

    @Override
    public void setTreeObjChild(List<E> list) {
        child = list;
    }
}
